package com.example.abe.diandi.user.activity;

import android.text.Editable;
import android.text.TextWatcher;
import android.widget.EditText;
import android.widget.TextView;

import com.example.BindView;
import com.example.OnClick;
import com.example.abe.diandi.R;
import com.example.abe.diandi.base.BaseActivity;

import example.abe.com.framework.util.ToastUtil;

public class ForgetPasswordActivity extends BaseActivity {

    @BindView(R.id.act_forget_password_tv_forget_password)
    protected TextView mTvForgetPassword;

    @BindView(R.id.act_forget_password_et_username)
    protected EditText mEtUsername;

    @BindView(R.id.act_forget_password_et_password)
    protected EditText mEtPassword;

    private String mStrUsername;
    private String mStrPassword;

    @Override
    public int getLayoutID() {
        return R.layout.activity_forget_password;
    }

    @Override
    public void initData() {
    }

    @Override
    public void initView() {
        mEtUsername.addTextChangedListener(mEtWatcher);
        mEtPassword.addTextChangedListener(mEtWatcher);
    }

    @Override
    public void onSideSlipEvent(){
        finish();
    }

    TextWatcher mEtWatcher = new TextWatcher() {
        @Override
        public void beforeTextChanged(CharSequence s, int start, int count, int after) {

        }

        @Override
        public void onTextChanged(CharSequence s, int start, int before, int count) {

        }

        @Override
        public void afterTextChanged(Editable s) {
            mStrUsername = mEtUsername.getText().toString();
            mStrPassword = mEtPassword.getText().toString();
        }
    };

    @OnClick({R.id.act_forget_password_tv_forget_password})
    protected void registerAction(){
        ToastUtil.makeText("重置密码成功");
        finish();
    }
}
